package com.itboye.mengwu.data.presenter;

import java.util.List;
import java.util.Observer;

import com.itboye.core.interfaces.ICompleteListener;
import com.itboye.core.object.BasePresenter;
import com.itboye.core.object.ResultEntity;
import com.itboye.mengwu.app.ui.main.MainPresenter;
import com.itboye.mengwu.data.interfaces.ILiShiTiXianInfaser;
import com.itboye.mengwu.data.model.WithdrawalsBean;
import com.itboye.mengwu.data.repository.LiShiTiXianRepository;

public class LiShiTiXianPresenter extends BasePresenter implements
		ILiShiTiXianInfaser<WithdrawalsBean> {

	// 历史提现
	public static final String LiSHiTiXIan_success = MainPresenter.class
			.getName() + "_LiSHiTiXIan_success";
	public static final String LiSHiTiXIan_fail = MainPresenter.class.getName()
			+ "_LiSHiTiXIan_fail";

	// 历史提现
	public static final String ShenQingTiXIan_success = MainPresenter.class
			.getName() + "_ShenQingTiXIan_success";
	public static final String ShenQingTiXIan_fail = MainPresenter.class
			.getName() + "_ShenQingTiXIan_fail";
	
	
	// 历史提现
		public static final String BangDing_success = MainPresenter.class
				.getName() + "_BangDing_success";
		public static final String BangDing_fail = MainPresenter.class
				.getName() + "_BangDing_fail";

	public LiShiTiXianPresenter(Observer observer) {
		super(observer);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void add(WithdrawalsBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void delete(WithdrawalsBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void update(WithdrawalsBean model) {
		// TODO Auto-generated method stub

	}

	@Override
	public void getInfo(WithdrawalsBean model) {
		// TODO Auto-generated method stub
		ILiShiTiXianInfaser<WithdrawalsBean> redBag = new LiShiTiXianRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(LiSHiTiXIan_success);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(LiSHiTiXIan_fail);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.getInfo(model);// (model);
	}

	@Override
	public List<WithdrawalsBean> queryYouHuiQuan(WithdrawalsBean model) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void getTiXian(String uid, String money) {
		// TODO Auto-generated method stub
		ILiShiTiXianInfaser<WithdrawalsBean> redBag = new LiShiTiXianRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(ShenQingTiXIan_success);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(ShenQingTiXIan_fail);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.getTiXian(uid, money);// (model);//(model);
	}

	@Override
	public void getBangDing(String uid, String mobile, String code,
			String account, String realname) {
		ILiShiTiXianInfaser<WithdrawalsBean> redBag = new LiShiTiXianRepository(
				new ICompleteListener() {

					@Override
					public void success(ResultEntity result) {
						result.setEventTag(Tag_Success);
						result.setEventType(BangDing_success);
						setChanged();
						notifyObservers(result);
					}

					@Override
					public void failure(ResultEntity result) {
						// TODO Auto-generated method stub
						result.setEventTag(Tag_Success);
						result.setEventType(BangDing_fail);
						setChanged();
						notifyObservers(result);
					}
				});
		redBag.getBangDing(uid, mobile, code, account,realname);
	}

}
